::添加环境变量${NAME}
@echo off
#set( $MyName = "John Smith" )
set( $MyName = "John Smith" )
echo 添加gradle4.7环境变量
set regpath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
set evname=${NAME}
set gradlepath="C:\Program Files (x86)\Work\gradle-4.7"
::添加gradle4.7节点
reg add "%regpath%" /v %evname% /d %gradlepath% /f
::追加path节点
reg add "%regpath%" /v "Path" /d "%Path%;%%${NAME}%%\bin" /f
pause>nul